package Colorful;

/**
 * @author zihao
 * @date 2025/3/19 21:40
 * @VERSION
 * @description
 **/
public class Flower {
    private int id; // 鲜花编号
    private String name; // 鲜花名称
    private double price; // 鲜花价格
    private int sales; // 销售数量

    // 无参构造
    public Flower() {
    }

    // 有参构造
    public Flower(int id, String name, double price, int sales) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.sales = sales;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getSales() {
        return sales;
    }

    public void setSales(int sales) {
        this.sales = sales;
    }

    // 重写 toString 方法，方便输出
    @Override
    public String toString() {
        return "鲜花编号: " + id + ", 鲜花名称: " + name + ", 价格: " + price + "元, 销售数量: " + sales;
    }
}